package com.hk.utils;

import javafx.util.Pair;
import org.springframework.util.DigestUtils;

public class SaltMD5Util {


    /**
     * md5指定盐加密
     * @param encrypt 需要加盐加密的字符串
     * @param salt 盐
     * @return
     */
    public static String add(String encrypt, String salt) {
        Pair<String, String> pair;
        StringBuilder sb = new StringBuilder();

        sb.append(salt).append(encrypt);
        byte[] bytes = sb.toString().getBytes();
        encrypt = DigestUtils.md5DigestAsHex(bytes);
        System.out.println(encrypt);
        return encrypt;
    }
}
